﻿@using Microsoft.AspNetCore.Mvc.Localization
@inject IViewLocalizer Localizer
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="google" content="notranslate" />
    <title>OCPP.Core - @ViewData["Title"]</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.1/css/all.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css">
    <link rel="stylesheet" href="~/lib/bootstrap-dialog/bootstrap-dialog.min.css" />
    <link rel="stylesheet" href="~/css/site.css" />
</head>
<body>
    <header>
        <nav class="navbar navbar-expand-lg navbar-light bg-light">
            <a class="navbar-brand" asp-area="" asp-controller="@Constants.HomeController" asp-action="Index"><i class="fas fa-charging-station"></i> OCPP.Core</a>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>

            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav mr-auto">
                    @if (this.User != null && this.User.Identity != null && this.User.Identity.IsAuthenticated)
                    {
                        <li class="nav-item active">
                            <a class="nav-link" href="~/">@Localizer["Overview"] <span class="sr-only">(current)</span></a>
                        </li>
                        @if (this.User.IsInRole(Constants.AdminRoleName))
                        {
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                    @Localizer["Administration"]
                                </a>
                                <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                                    <a class="dropdown-item" href="~/Home/ChargeTag">@Localizer["ChargeTags"]</a>
                                    <a class="dropdown-item" href="~/Home/ChargePoint">@Localizer["ChargePoints"]</a>
                                    <a class="dropdown-item" href="~/Home/Connector">@Localizer["Connectors"]</a>
                                    <a class="dropdown-item" href="~/Home/ChargeReport">@Localizer["ChargeReport"]</a>
                                </div>
                            </li>
                        }
                    }
                </ul>
                @{
                    if (this.User != null && this.User.Identity != null && this.User.Identity.IsAuthenticated)
                    {
                        <ul class="navbar-nav ml-auto nav-flex-icons">
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink-333" data-toggle="dropdown"
                                   aria-haspopup="true" aria-expanded="false">
                                    @this.User.Identity.Name <i class="fas fa-user"></i>
                                </a>
                                <div class="dropdown-menu dropdown-menu-right dropdown-default"
                                     aria-labelledby="navbarDropdownMenuLink-333">
                                    <a class="dropdown-item" href="~/Account/Logout">@Localizer["Logout"]</a>
                                </div>
                            </li>
                        </ul>
                    }
                }
            </div>
        </nav>

    </header>
    <div class="container">
        <main role="main" class="pb-3">
            @RenderBody()
        </main>
    </div>

    <footer class="border-top footer text-muted">
        <div class="container">
            OCPP.Core Management @string.Format("V{0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(3))
        </div>
    </footer>
    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.1/jquery.validate.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.11/jquery.validate.unobtrusive.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/locales/bootstrap-datepicker.de.min.js"></script>
    <script src="~/lib/bootstrap-dialog/bootstrap-dialog.min.js"></script>
    <script src="~/js/site.js" asp-append-version="true"></script>
    @RenderSection("Scripts", required: false)
</body>
</html>
